#ifndef DBUSAPP_H
#define DBUSAPP_H

#include <QString>
#include <QObject>

/*
  si changement,
qdbuscpp2xml -S -M handlemplayer.h -o org.kdeadmouse.apps.genericapp.xml
qdbusxml2cpp -c PlayerAdaptor -a playeradaptor.h:playeradaptor.cpp org.kdeadmouse.apps.genericapp.xml
  */
class DbusApp : public QObject
{
    Q_OBJECT
    Q_PROPERTY(bool isRunning READ isRunning())
    Q_PROPERTY(QString appName READ appName())


public:
    inline explicit DbusApp (QString appName, QObject *parent=0): QObject(parent){m_appName = appName;}
    Q_INVOKABLE inline bool isRunning(){return true;}
    Q_INVOKABLE inline QString appName(){return m_appName;}

    Q_INVOKABLE virtual void requestMedia(QString reqkey, QString askerApp, QString reqName, QString reqParam) = 0 ;
    Q_INVOKABLE virtual QString getInfo(QString infokey) = 0 ;
    Q_INVOKABLE virtual void show() = 0;
    Q_INVOKABLE virtual void hide() = 0;


signals:
    void responseMedia(QString reqkey,QString response);
    void showed();
    void hided();
    void onHome();

protected:
    QString m_appName;

};

#endif // DBUSAPP_H
